﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace ZPod.MTG.Communication.Web
{
	/// <summary>
	/// Implementacion de IGameServerService.
	/// Wrapper de metodos al singleton de ZPod.MTG.Communication.Web.Server
	/// </summary>
	public class GameServerService : IGameServerService
	{
		#region IGameServerService Members

		public void CreateGame(string name)
		{
			Server.Instance.CreateGame(name);
		}

		public List<string> GetAvailableGames()
		{
			return Server.Instance.AvailableGames;
		}

		public void SetState(string game, string player, PlayerState state)
		{
			Server.Instance.SetState(game, player, state);
		}

		public GameState GetGame(string game)
		{
			return Server.Instance.GetGame(game);
		}
		
		public void AddCommonCard(string game, Card card)
		{
			Server.Instance.AddCommonCard(game, card);
		}

		public void RemoveCommonCard(string game, int index)
		{
			Server.Instance.RemoveCommonCard(game, index);
		}

		#endregion
	}
}
